﻿@{
    ViewBag.Title = "实名验证";
    Layout = "~/Views/Shared/_LayoutFore.cshtml";
}
@model LY.Entity.U_Member
@section script{
    @*<link href="~/Content/assets/css/Layout/css/main.css" rel="stylesheet" />
    <link href="~/Content/assets/css/plugin/validator.css" rel="stylesheet" />*@
    <script type="text/javascript">
        $(function () {
            $("form").Validform({
                tiptype: 3
            });
        })
    </script>

}

<style>
    .tab-content dl dt:first-child {
        width: 100px;
        text-align: right;
    }
</style>
<div class="RightContrent">
    <div style="margin-left: 50px; margin-right: 50px;">
        <div class="tab-content">
            <div class="line10"></div>
            <div class="line10"></div>
            <div class="tab_title">@ViewBag.Title</div>
            <div class="tab-content">
                <div style="width: 16px; height: 12px; float: left;">
                    <img src="~/Content/Images/leftarraw.png" />
                </div>
            </div>

            <div class="tab-content_border">


                <div class="u-center">
                    @{ 
                        if (Model.IsIDValidate == true)
                        {
                        <div class="u-form-wrap">

                            <div class="tab-content">
                                @*<dl>
                                    <dt>用户名：</dt>
                                    <dd>@Model.Name </dd>
                                </dl>*@
                                @*<dl>
                                    <dt>盛付通账户：</dt>
                                    <dd>
                                        @ViewBag.userName  <a href="javascript:void(0)" onclick="QuShengFuTong()">查看账户信息</a></dd>
                                </dl>*@
                                <dl>
                                    <dt>真实姓名：</dt>
                                    <dd>@Model.RealName</dd>
                                </dl>
                                <dl>
                                    <dt>身份证号码：</dt>
                                    <dd>@Model.IDCode</dd>
                                </dl>
                            </div>
                        </div> 
                        <form action="@ViewBag.SftAddress/index.html" method="POST" id="formShouYe" target="_blank">
                            <input type="hidden" name="merchantNo" id="tzmerchantNo" value="@ViewBag.merchantNo"/>
                            <input type="hidden" name="timestamp" id="tztimestamp" value="" />
                            <input type="hidden" name="userName" id="tzuserName" value="@ViewBag.userName"/>
                            <input type="hidden" name="sign" id="tzsign" value="" />
                        </form>
                        <script>

                            function QuShengFuTong() {
                                var sign = "merchantNo=" + $("#tzmerchantNo").val() + "&timestamp=temp&userName=" + $("#tzuserName").val();
                                sign = sign.replace(/\&/g, "|");
                                $.ajax({
                                    url: "/Account/GetSign2",
                                    type: "Post",
                                    success: function (data) {
                                        var time = data.substring(0, 14);
                                        var sign2 = data.substring(14, data.length);
                                        $("#tztimestamp").val(time);
                                        $("#tzsign").val(sign2);
                                        $("#formShouYe").submit();
                                    },
                                    data: "sign=" + sign,
                                });
                            }
                        </script>
                        }
                        else
                        {
                        <div class="u-form-wrap">

                            <form action="@ViewBag.SftAddress/user/account/register.html" method="post" id="Register">
                                <input type="hidden" name="merchantNo" id="merchantNo" value="@ViewBag.merchantNo" />
                                <input type="hidden" name="timestamp" id="timestamp" value="" />
                                <input type="hidden" name="ID" value="@Model.ID"/>
                                <input type="hidden" id="userName" name="userName" class="input txt" style="width: 200px;" value="@ViewBag.userName" />
                                <div class="tab-content">
                                    @*<dl>
                                        <dt>用户名：</dt>
                                        <dd>@Model.Name</dd>
                                    </dl>*@
                                    @*<dl>
                                        <dt>盛付通账户：</dt>
                                        <dd>
                                            <input type="text" id="userName" name="userName" class="input txt" style="width: 200px;" value="@ViewBag.userName" readonly="readonly"/></dd>
                                    </dl>*@
                                    <dl>
                                        <dt>真实姓名：</dt>
                                        <dd>@Html.TextBox("realName", Model.RealName, new { @class = "input  normal", datatype = "s2-10" })</dd>
                                    </dl>
                                    <dl>
                                        <dt>身份证号码：</dt>
                                        <dd>@Html.TextBox("idCardNo", Model.IDCode, new { @class = "input  normal", datatype = "idcard" })</dd>
                                    </dl>

                                    <dl>
                                        <dd style="margin-left: 100px">
                                            <button type="button" class="btn" onclick="Register()">开 通</button>
                                            <a href='@Url.Action("Index")' class="btn" style="color:white">返回</a>
                                            <input type="hidden" name="callback" id="callback" value="@ViewBag.backAddress/Account/RegisterCallBack" />
                                            <input type="hidden" name="sign" id="sign" value="" />
                                        </dd>
                                    </dl>

                                </div>


                            </form>

                        </div>
                        <script>
                            function Register() {
                                var sign = "callback=" + $("#callback").val() + "&idCardNo=" + $("#idCardNo").val() + "&merchantNo=" + $("#merchantNo").val()
                                    + "&realName=" + $("#realName").val() + "&timestamp=temp&userName=" + $("#userName").val();
                                sign = sign.replace(/\&/g, "|");
                                $.ajax({
                                    url: "/Account/SftRegister",
                                    type: "Post",
                                    success: function (data) {
                                        var time = data.substring(0, 14);
                                        var sign2 = data.substring(14, data.length);
                                        $("#timestamp").val(time);
                                        $("#sign").val(sign2);
                                        $("#Register").submit();
                                    },
                                    data: "sign=" + sign + "&idCardNo=" + $("#idCardNo").val() + "&realName=" + $("#realName").val() + "&userName=" + $("#userName").val(),
                                });
                            }

                        </script>
                               
                        }
                       
                       
                    }

                </div>

            </div>
        </div>
    </div>
</div>
